package io.coderyeah.ymcc.anno;

import io.coderyeah.ymcc.validator.PhoneValidator;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.*;

/**
 * @author lqs
 * @date 2022/10/19 19:04
 */
@Target({ElementType.FIELD,ElementType.PARAMETER})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Constraint(validatedBy = PhoneValidator.class)//此处指定了注解的实现类为PhoneValidator
public @interface Phone {// 用来校验手机号码的注解

    String message() default "无效的手机格式";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}
